<include file="Common:layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div id="list">
        <div class="fixed-bar">
            <div class="item-title">
                <div class="subject">
                    <h3>SMS短信模板</h3>
                    <h5>短信发送模板设置</h5>
                </div>
            </div>
        </div>
        <!-- 操作说明 -->
        <div class="explanation" id="explanation">
            <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
                <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
                <span id="explanationZoom" title="收起提示"></span>
            </div>
            <ul>
                <li>为短信服务正常使用，请确认短信模板与您短信服务的模板一致。</li>
            </ul>
        </div>

        <div class="flexigrid">
            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0">
                        <thead>
                        <tr>
                            <th axis="col1" align="center">
                                <div style="text-align: center; width: 80px;">操作</div>
                            </th>
                            <th axis="col2" class="" align="left">
                                <div style="text-align: center; width: 100px;">短息服务</div>
                            </th>
                            <th axis="col2" class="" align="left">
                                <div style="text-align: center; width: 100px;">模板名称</div>
                            </th>
                            <th axis="col2" class="" align="left">
                                <div style="text-align: center; width: 400px;">模板内容</div>
                            </th>
                            <th axis="col2" class="" align="left">
                                <div style="text-align: center; width: 180px;">签名</div>
                            </th>
                            <th axis="col2" class="" align="left">
                                <div style="text-align: center; width: 100px;">应用场景</div>
                            </th>
                            <th style="width:100%" axis="col7">
                                <div></div>
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class="tDiv">
                <div class="tDiv2">
                    <div class="fbutton">
                        <a href="{:U('System/add_sms_template')}">
                            <div class="add" title="添加模板"><span><i class="fa fa-plus"></i>添加模板</span></div>
                        </a>
                    </div>
                </div>
                <div style="clear:both"></div>
            </div>
            <div class="bDiv" style="height: auto;">
                <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                    <table>
                        <tbody>
                        <foreach name="sms_templates" item="sms">
                            <tr id="row130" data-id="130" class="">
                                <td class="col1" align="center">
                                    <div style="text-align: center;width:80px;">
                                        <a class="btn red" onclick="delRegion('{$sms.tpl_id}')" ><i class="fa fa-trash"></i>删除</a>
                                    </div>
                                </td>
                                <td class="col2" align="left">
                                    <div style="text-align: center; width: 100px;">{$sms['sms_sv']}</div>
                                </td>
                                <td class="col2" align="left">
                                    <div style="text-align: center; width: 100px;">{$sms['sms_title']}</div>
                                </td>
                                <td class="col2" align="left">
                                    <div style="text-align: center; width: 400px;">{$sms['tpl_content']}</div>
                                </td>
                                <td class="col2" align="left">
                                    <div style="text-align: center; width: 180px;">{$sms['sms_sign']}</div>
                                </td>
                                <td class="col2" align="left">
                                    <div style="text-align: center; width: 100px;">{$tpl_scene[$sms['send_scene']]}</div>
                                </td>
                                <td align="" class="" style="width: 100%;">
                                    <div>&nbsp;</div>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
                <div class="iDiv" style="display: none;"></div>
            </div>
        </div>
    </div>
</div>
<script>
    function delRegion( id){
        layer.confirm('确定删除此模板？', {icon: 3, title:'删除提示'}, function(){
            $.ajax({
                url: "{:U('System/del_sms_template')}",
                type: "post",
                data: {tpl_id : id},
                success: function (data)
                {
                    if(data.status == "success"){
                        location.reload(true);
                    }else{
                        layer.alert(data.msg);
                    }
                }
            });
        });
    }
</script>
</body>
</html>